package com.chatplus.application.common.util;

import cn.hutool.extra.validation.BeanValidationResult;
import cn.hutool.extra.validation.ValidationUtil;

/**
 * 封装参数验证
 */
public class CustomerValidation {

    public static String validate(Object input) {
        BeanValidationResult validationResult = ValidationUtil.warpValidate(input);
        if (validationResult.isSuccess()) {
            return null;
        }

        return validationResult.getErrorMessages().get(0).getMessage();
    }
}
